<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    h1{
        color: lightskyblue;
    }
    .odd{ color: chartreuse}
    .even{ color: lightskyblue}
</style>
<body>
<h1>打印九九乘法表</h1>
<p id="demo"></p>
<script>
    var type;
    document.write("<table>");
    for(var i=1;i<10;i++)
    {
        document.write("<tr>");
        for(var j=1;j<=i;j++)
        {
            if(i%2==0)
            {
                document.write("<td class='odd'>");
                document.write(j + "*"+i+"="+i*j);
                document.write("<td width='10px'>");
            }
            else
            {
                document.write("<td class='even'>");
                document.write(j + "*"+i+"="+i*j);
                document.write("<td width='10px'>");
            }

        }
    }
</script>
</body>
</html>